<template>
	<view style="opacity: 0">
		<view class="box-conatainer">
			<!-- 上边 -->
			<view class="top-box">
				<view class="title-box">
					<!-- <text class="title" onclick="tipClickHandler('楼宇全景')">{{ data.buildName }}</text> -->
					<text class="title" v-if="data.propertyImg ==null || data.propertyImg == ''">{{ data.buildName }}</text>
					<text class="title" v-else onclick="tipClickHandler('楼宇全景')">{{ data.buildName }}720</text>
				</view>
				<view class="icon-box">
					<img src="/industry/static/detail/720.png" mode="aspectFit" class="imgqi" />
					<img src="/industry/static/detail/tm.png"
						mode="aspectFit" class="imgqitm" />
					<img v-if="!data.buildImg || data.buildImg.indexOf('http') !== -1" :src="data.buildImg"
						mode="aspectFit" class="img" />
					<img v-else src="/industry/static/default.png" mode="aspectFit" class="img" />
					<img src="/industry/static/detail/build_mark_down.png" mode="aspectFit" class="icon" />
				</view>
			</view>
			<view class="bottom-box">
				<!-- 左边 -->
				<view class="left-box">
					<!-- 龙头企业 -->
					<view class="left-item">
						<view class="title-box">
							<text class="title" onclick="tipClickHandler('龙头企业')">龙头企业</text>
						</view>
						<view class="icon-box">
							<img v-if="!data.buildImg || data.buildImg.indexOf('http') !== -1" :src="data.buildImg"
								mode="aspectFit" class="img" />
							<img v-else src="/industry/static/default.png" mode="aspectFit" class="img" />
							<img src="/industry/static/detail/build_mark_right.png" mode="aspectFit" class="icon" />
						</view>
					</view>
					<!-- 空置面积 -->
					<view class="left-item">
						<view class="title-box">
							<text class="title" onclick="tipClickHandler('空置面积')">空置面积</text>
						</view>
						<view class="icon-box">
							<img v-if="!data.buildImg || data.buildImg.indexOf('http') !== -1" :src="data.buildImg"
								mode="aspectFit" class="img" />
							<img v-else src="/industry/static/default.png" mode="aspectFit" class="img" />
							<img src="/industry/static/detail/build_mark_right.png" mode="aspectFit" class="icon" />
						</view>
					</view>
				</view>
				<img style="width: auto; height: 20vh;min-width: 100px;" :src="data.iconPath" mode="aspectFit"
					:data="JSON.stringify(data)" onclick="iconViewImghandleClick(event)" />
				<!-- 右边 -->
				<view class="right-box-container" style="margin-top:60rpx">
					<!-- 右边上部-->
					<view class="right-box">
						<view class="icon-box">
							<img v-if="!data.buildImg || data.buildImg.indexOf('http') !== -1" :src="data.buildImg"
								mode="aspectFit" class="img" />
							<img v-else src="/industry/static/default.png" mode="aspectFit" class="img" />
							<img src="/industry/static/detail/build_mark_left.png" mode="aspectFit" class="icon" />
						</view>
						<view class="title-box">
							<text class="title" onclick="tipClickHandler('空间政策')">空间政策</text>
						</view>
					</view>
					<!-- 右边下部 -->
					<view class="right-box" style="margin-bottom: 40rpx">
						<view class="icon-box">
							<img v-if="!data.buildImg || data.buildImg.indexOf('http') !== -1" :src="data.buildImg"
								mode="aspectFit" class="img" />
							<img v-else src="/industry/static/default.png" mode="aspectFit" class="img" />
							<img src="/industry/static/detail/build_mark_left.png" mode="aspectFit" class="icon" />
						</view>
						<view class="title-box">
							<text class="title" onclick="tipClickHandler('重点企业')">重点产业</text>
						</view>
					</view>

				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'MatchingView',
		props: {
			data: {
				type: Object,
				default: () => ({}),
			},
		},
		mounted() {
			window.iconViewImghandleClick = this.iconViewImghandleClick
		},
		methods: {
			iconViewImghandleClick(e) {
				const json = e.currentTarget.getAttribute('data')
				const data = JSON.parse(json)
				console.log(data.name)
				this.$emit('click', data)
			},
		},
		data() {
			return {}
		},
	}
</script>

<style scoped lang="scss">
	.box-conatainer {
		pointer-events: none;
		position: relative;
		color: #1684fc;
		font-size: 24rpx;
		font-weight: 500;
		padding: 20rpx 0;

		.top-box {
			margin-bottom: -60rpx;

			.title-box {
				margin-top: 10rpx;
				display: inline-block;
				max-width: 100%;
			}

			.title {
				display: inline-block;
				pointer-events: auto;
				border-radius: 24rpx;
				border: 1px solid #3756fc;
				background: #fff;
				padding: 12rpx 24rpx;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				word-break: keep-all;
			}

			.icon-box {
				margin-top: 20rpx;
				position: relative;

				.img {
					position: absolute;
					width: 48rpx;
					height: 48rpx;
					border-radius: 50%;
					left: 0;
					right: 0;
					margin: 0 auto;
					top: 18rpx;
					background-color: rgba(0, 0, 0, 1);
					
				}

				.imgqi {
					position: absolute;
					width:40rpx;
					height: 30rpx;
					
					left: 0;
					right: 0;
					margin: 0 auto;
					top: 30rpx;
					z-index: 999;
					
					
				} 
                .imgqitm{
					position: absolute;
					width: 48rpx;
					height: 48rpx;
					border-radius: 50%;
					left: 0;
					right: 0;
					margin: 0 auto;
					z-index: 99;
					top: 18rpx;
				}
				.icon {
					width: 86rpx;
					height: 99rpx;
				}
			}
		}

		.bottom-box {
			display: flex;
			flex-direction: row;
			justify-content: center;
			align-items: center
		}

		.left-box {
			display: flex;
			flex-direction: column;
			margin-right: -100rpx;

			.left-item {
				display: flex;
				flex-direction: row;
				align-items: center;

				.title-box {
					margin-top: 30rpx;
					margin-right: -56rpx;
					display: inline-block;
				}

				.title {
					display: inline-block;
					border-radius: 24rpx;
					border: 1px solid #3756fc;
					background: #fff;
					padding: 12rpx 24rpx;
					padding-right: 60rpx;
					pointer-events: auto;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
					word-break: keep-all;
				}

				.icon-box {
					margin-top: 30rpx;
					position: relative;

					.img {
						position: absolute;
						width: 48rpx;
						height: 48rpx;
						border-radius: 50%;
						left: -10rpx;
						right: 0;
						margin: 0 auto;
						top: 18rpx;
					}

					.icon {
						height: 86rpx;
						width: 99rpx;
					}
				}
			}
		}

		.right-box-container {
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			margin-left: -100rpx;
		}

		.right-box {
			display: flex;
			flex-direction: row;
			align-items: center;
			right: 0;

			.title-box {
				margin-top: 30rpx;
				margin-left: -56rpx;
				display: inline-block;
			}

			.title {
				display: inline-block;
				border-radius: 24rpx;
				border: 1px solid #3756fc;
				background: #fff;
				padding: 12rpx 24rpx;
				padding-left: 60rpx;
				pointer-events: auto;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				word-break: keep-all;
			}

			.icon-box {
				margin-top: 30rpx;
				position: relative;

				.img {
					position: absolute;
					width: 48rpx;
					height: 48rpx;
					border-radius: 50%;
					left: 10rpx;
					right: 0;
					margin: 0 auto;
					top: 18rpx;
				}

				.icon {
					height: 86rpx;
					width: 99rpx;
				}
			}
		}
	}
</style>